/**
 * @file sta_cmd.hpp
 * @brief 基站命令封装类
 * @author chenhonlin (chenhonglinchl@aliyun.com)
 * @version 1.0
 * @date 2020-08-05
 * 
 * @copyright Copyright (c) 2020  XX公司
 * 
 * @par log:
 * <table>
 * <tr><th>Date       <th>Version <th>Author      <th>Description
 * <tr><td>2020-08-05 <td>1.0     <td>chenhonglin     <td>内容
 * </table>
 */

#pragma once

#include<rtthread.h>

class cmd_line
{
    #define MAX_LEN 64
public:

    cmd_line(){
        for(int i=0; i<MAX_LEN; i++)
            cmd[i]=0;
        len = 0;
    }

    cmd_line(int num){
        this->len = MAX_LEN;
        for(int i=0; i<MAX_LEN; i++)
            this->cmd[i]=num;
    }

    cmd_line(const cmd_line& obj){
        this->len =obj.len;
        for(int i=0; i<obj.len; i++)
            this->cmd[i]=obj.cmd[i];
    }

    cmd_line& operator=(int num){
        for(int i=0; i<MAX_LEN; i++)
            cmd[i]=num;
    }

    uint8_t cmd[MAX_LEN];
    int len;
};

class cmd_line_group
{
    #define MAX_NUM 4
public:

    cmd_line_group(){};

    cmd_line_group(uint8_t* list, int len){
        for(int i=0; i<len; i++)
        {
            group[0].cmd[i] = list[i];
            group[0].len = len;
            num = 1;
        } 
    }

    cmd_line_group(const cmd_line_group& obj){
        this->num =obj.num;
        for(int i=0; i<obj.num; i++)
            this->group[i]=obj.group[i];
    }
    
    cmd_line group[MAX_NUM];
    int num;
};